package cn.com.dcsgo.mybatis.plus.mapper;

import cn.com.dcsgo.mybatis.plus.po.User;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * @author Dcsgo
 * @since 2024/8/23 15:41
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {
    @Update("update user set balance = balance + #{amount} ${ew.customSqlSegment}")
    int updateBalanceByWrapper(@Param("amount") int amount,@Param(Constants.WRAPPER) LambdaUpdateWrapper<User> wrapper);
}
